
import MenuService from './services/menuService.js';
import {
    nextTick
} from '../common/utils.js';
import Vue from 'vue';
import store from 'store';

let menuService = new MenuService();
let vm = new Vue({
    el: '#sidebar-menu',
    data: {
        menu: {},
    },
    methods: {
        init: async function () {
            let res = await menuService.getMenuAsync();

            if ('application/json' == res.type) {
                this.menu = res.body;
                await nextTick();
                setMenu();
            }
        }
    }
});
vm.init();